/*
 * @Author: liutongchao 1923236391@qq.com
 * @Date: 2023-04-28 11:24:35
 * @LastEditors: liutongchao 1923236391@qq.com
 * @LastEditTime: 2023-06-25 17:16:04
 * @FilePath: \greenbeeadmin\controllers\admin\admin.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package controllers

import (
	adminService "greenbeeadmin/controllers/admin/service"
	greenbee "greenbeeadmin/controllers/greenbee"
	"greenbeeadmin/models"
)

// 菜单管理
type MenuController struct {
	greenbee.AdminBaseController
}

// 获取系统菜单数据 ini
func (c *MenuController) Get() {
	var systemMenuService adminService.SystemMenuService
	//查询管理员信息
	user := c.GetSession("user")
	uid := 0
	if user != nil {
		adminuser := user.(models.AdminUser)
		uid = adminuser.Id
	}

	systemInit := systemMenuService.GetSystemInit(uid)
	c.Data["json"] = systemInit
	c.ServeJSON()
}
